package com.example.demo.excel.model;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.HeadStyle;
import com.alibaba.excel.enums.poi.FillPatternTypeEnum;
import com.diboot.file.excel.BaseExcelModel;
import com.diboot.file.excel.annotation.ExcelBindField;
import com.diboot.iam.entity.IamUser;
import com.example.demo.entity.Customer;
import com.example.demo.entity.Goods;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;

import java.util.List;

/**
* 订单项 导入model定义
* @author MyName
* @version 1.0
* @date 2023-09-13
* Copyright © MyCompany
*/
@Getter @Setter
@ExcelIgnoreUnannotated
@HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 1)
public class OrderSkuImportModel extends BaseExcelModel {

    /**
     * 名称
     */
//    @Length(max=100, message="名称长度应小于100")
    @ExcelProperty(value = "订单号")
    private Long ordersId;

    @ExcelBindField(entity = Customer.class, field = "name", setIdField = "customerId")
    @ExcelProperty(value = "客户名称")
    private String customerName;

    @ExcelIgnore
    private Long customerId;

    @ExcelBindField(entity = Goods.class, field = "name", setIdField = "goodsId")
    @ExcelProperty(value = "产品名称")
    private String goodsName;

    @ExcelIgnore
    private Long goodsId;

    @Length(max=100, message="尺寸长度应小于100")
    @ExcelProperty(value = "尺寸")
    private String skuSize;

    @ExcelProperty(value = "数量")
    private Integer quantity;

    @ExcelProperty(value = "附件")
    private String ext;

    @ExcelProperty(value = "附件数量")
    private Integer extQuantity;
//    /**
//     * 更新人
//     */
//    @ExcelBindField(entity = IamUser.class, field = "realname", setIdField = "updateBy")
//    @ExcelProperty(value = "更新人")
//    private String updateByName;
//
//    private Long updateBy;

}
